package com.rr.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author RR
 * @date 2022/6/22 21:17
 */
@Configuration
public class RestTemplateConfig {
    @Bean
    @LoadBalanced  //要加这个注解，否则走不了负载均衡，也会识别不到消费端
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
